/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1646412276529_1062';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  config.mysql = {
    client: {
      host: 'localhost', // 数据库的域名，
      port: 3306, // 数据库端口号
      user: 'root',
      password: 'snmsung520',
      database: '1907aday14',
    },
  };

  // 关闭防火墙
  config.security = {
    csrf: {
      enable: false,
    },
  };

  // 允许post接受文件流信息
  config.multipart = {
    mode: 'file',
  };

  config.io = {
    namespace: {
      '/io': {
        connectionMiddleware: [],
        packetMiddleware: [],
      },
    },
  };

  // 开启跨域
  config.cors = {
    origin: '*',
    allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
  };

  return {
    ...config,
    ...userConfig,
  };
};
